<!--[if lt IE 10]>
	<link rel='stylesheet' type='text/css' href='<?php echo DIR_CSS?>jquery.tabs-ie.css'>
	<link href="<?php echo DIR_CSS?>ie_style.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="<?php echo DIR_JS?>ie_png.js"></script>
    <script type="text/javascript">
       ie_png.fix('.png');
       var ckcss = 'contentie.css';
	</script>
    
    <STYLE TYPE="text/css">

      @font-face {
        font-family: Khmer OS;
        font-style:  normal;
        font-weight: normal;
        src: url("KhmerOSsys.eot");
      }
      @font-face {
        font-family: Limon S1;
        font-style:  normal;
        font-weight: normal;
        src: url("LimonS1.eot");
      }
    </STYLE>
<![endif]-->
<![if !IE ]>
<STYLE TYPE="text/css">

  @font-face {
    font-family: Limon S1;
    font-style:  normal;
    font-weight: normal;
    src: url(LimonS1.ttf);
  }

  @font-face {
    font-family: Khmer OS;
    font-style:  normal;
    font-weight: normal;
    src: url(KhmerOSsys.ttf);
  }
  

</STYLE>
<link rel="stylesheet" type="text/css" href="<?php echo DIR_CSS?>style.css" media="screen" />
	<link rel='stylesheet' type='text/css' href='<?php echo DIR_CSS?>blockui.css'>
	<link rel='stylesheet' type='text/css' href='<?php echo DIR_CSS?>jquery-ui.css'>
    <link rel='stylesheet' type='text/css' href='<?php echo DIR_CSS?>jquery.tabs.css'>
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
    <script src="<?php echo DIR_JS?>jquery.js" type="text/javascript"></script>
    <script type='text/javascript' language='javascript' src='<?php echo DIR_JS?>jquery.blockUI.js'></script>
    <script type='text/javascript' language='javascript' src='<?php echo DIR_COMPONENT?>ckeditor/ckeditor.js'></script>
    <script src="<?php echo DIR_JS?>common.js" type="text/javascript"></script>
    <script type='text/javascript' language='javascript' src='<?php echo DIR_VIEW?>js/uidatepicker.js'></script>
    <script type='text/javascript' language='javascript' src='<?php echo DIR_VIEW?>js/jquery.dimensions.js'></script>
    <script type='text/javascript' language='javascript' src='<?php echo DIR_VIEW?>js/jquery.combobox.js'></script>
    <title>Ben Solution Content Management System</title>
    <script src="<?php echo DIR_JS?>menu-collapsed.js" type="text/javascript"></script>
	<div class="main">
    	<div class="left sidebar" style="width:28%;">
            <div class="section">
                <div class="section-title">Product search</div>
                <div class="content">
                    <ul class="nicelist">
                        <li>
                            <a href="?route=soft/product/browse&sitemapid=<?php echo $type?>">All</a>&nbsp;&nbsp; 
                        </li> 
                        
                    </ul>
                    <ul id="menu">
                        <?php echo $catagory?>
                    </ul>
                </div>
                
            </div>        	
        </div>
        <div class="right" style="width:70%">
            <div class="section">
            
                <div class="section-title">
                    <?php echo $breadcrumb?>
                </div>
                
                <div class="section-content">
                
                    <div class="left">
                        
                        <h3><?php echo html_entity_decode($heading_title)?></h3>
                    
                    </div>
                    
                    <div class="right">
                        <a class="button" onClick="window.close();">Select</a>
                        <a class="button" onClick="closePopup()">Close</a>
                    </div>
                    <div class="clearer">&nbsp;</div>
                    
                    <div>
                        <form id="postlist" name="postlist" method="get" action="">
                            
                        <table class="data-table" width="100%">
                        
                            <thead>
                                <th><input type="checkbox" onclick="$('.select').attr('checked', this.checked);" class="inputchk" onchange="selectProduct()">&nbsp;</th>
                                <th width="20%">Product name</th>
                                
                                <th><?php echo $this->document->text['text_price']?></th>
                                <th>Quantity</th>
                                <th><?php echo $this->document->text['text_unit']?></th>
                                <?php if($sitemapid != "category") {?>
                                <th width="10%"><?php echo $this->document->text['text_control']?></th>
                                <?php } ?>
                            </thead>
                            
                            <tbody>
                                <?php foreach($medias as $media) {?>
                                <tr>
                                    <td><input type="checkbox" class="select" name="select[<?php echo $media['mediaid']?>]" value="<?php echo $media['mediaid']?>" onclick="selectProduct()">&nbsp;</td>
                                    <td><b><?php echo $media['title']?></b>&nbsp;</td>
                                    
                                    <td align="right"><?php echo $this->string->numberFormate($media['price'])?>&nbsp;</td>
                                    <td align="right"><?php echo $this->string->numberFormate($media['quantity'])?>&nbsp;</td>
                                    <td><?php echo $media['unit']?>&nbsp;</td>
                                    <?php if($sitemapid != "category") {?>
                                    <td><?php echo $media['link']?>&nbsp;</td>
                                    <?php } ?>
                                </tr>
                                <?php } ?>
                            </tbody>
                        
                        </table>
                        </form>
                    </div>
                    
                    <div>
                        <?php echo $nextlink?>
                        <?php echo $prevlink?>
                        <div class="clearer">&nbsp;</div>
                    </div>
                    
                </div>
            
            </div>
        
        </div>
        
        <div class="clearer">&nbsp;</div>
    </div>


<script language="javascript">
function selectProduct()
{
	parent.opener.window.document.frm.listproductid.value="";
	
	$(".select").each(function(index){
		
		if(this.checked == true)
		{
			
			parent.opener.window.document.frm.listproductid.value += $(this).val()+",";
		}
	})
}

function closePopup()
{
	parent.opener.window.document.frm.listproductid.value="";
	window.close();
}

</script>
